//
//  FJScoreView.swift
//  FruitJuice
//
//  Created by Rae on 2024/1/3.
//

import UIKit

class FJScoreView: UIView {

    private var onebutton: UIButton = {
        let button = UIButton(type: .custom)
        button.setImage("FJ_Home_score".toImage, for: .normal)
        button.setImage("FJ_Home_score_sel".toImage, for: .selected)
        return button
    }()
    private var twobutton: UIButton = {
        let button = UIButton(type: .custom)
        button.setImage("FJ_Home_score".toImage, for: .normal)
        button.setImage("FJ_Home_score_sel".toImage, for: .selected)
        return button
     }()
    private var threebutton: UIButton = {
        let button = UIButton(type: .custom)
        button.setImage("FJ_Home_score".toImage, for: .normal)
        button.setImage("FJ_Home_score_sel".toImage, for: .selected)
        return button
     }()
    private var fourbutton: UIButton = {
        let button = UIButton(type: .custom)
        button.setImage("FJ_Home_score".toImage, for: .normal)
        button.setImage("FJ_Home_score_sel".toImage, for: .selected)
        return button
     }()
    private var fivebutton: UIButton = {
        let button = UIButton(type: .custom)
        button.setImage("FJ_Home_score".toImage, for: .normal)
        button.setImage("FJ_Home_score_sel".toImage, for: .selected)
        return button
     }()
    private let scoreLabel = c_make_ex(UILabel.self)
        .color("#FF9133").font(18.font_regular).text("4.5").end()
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        
        backgroundColor = .clear
        
        subviews{
            onebutton
            twobutton
            threebutton
            fourbutton
            fivebutton
            scoreLabel
        }
        
        onebutton.leading(18).bottom(15.5).width(20).height(19)
        twobutton.leading(46).bottom(15.5).width(20).height(19)
        threebutton.leading(74).bottom(15.5).width(20).height(19)
        fourbutton.leading(102).bottom(15.5).width(20).height(19)
        fivebutton.leading(130).bottom(15.5).width(20).height(19)
        scoreLabel.leading(161)
        scoreLabel.CenterY == fivebutton.CenterY
    }
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
